package org.lalib.util;

import java.util.Locale;

import javax.faces.context.FacesContext;

import org.springframework.stereotype.Service;

@Service("languageUtil")
public class LanguageUtil {

	private String selectedLanguage = "tr";

	public String login() {
		return "adminLogin";
	}

	public void changeLanguage(String language) {
		FacesContext.getCurrentInstance().getViewRoot().setLocale(new Locale(language));
	}

	public void changeLanguage() {
		changeLanguage(getSelectedLanguage());
	}

	public String getSelectedLanguage() {
		return selectedLanguage;
	}

	public void setSelectedLanguage(String selectedLanguage) {
		this.selectedLanguage = selectedLanguage;
	}
}